<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use App\Services\StaffService;
use Illuminate\Http\Request;

class StaffController extends Controller
{
    public function getStaffList(StaffService $staffService , Request $request)
    {
        $params = $request->input();
        $result = $staffService->getStaffList($params);
        return $this->responseSuccess($result);
    }

    public function staffList(StaffService $staffService , Request $request)
    {
        $params = $request->input();
        $result = $staffService->getList($params);
        return $this->responseSuccess($result);
    }

    public function staffEdit(StaffService $staffService , Request $request)
    {
        $params = $request->input();
        $result = $staffService->staffUpdate($params);
        if($result)
            return $this->responseSuccess($result);
        else
            return $this->responseError("更新失败，请重试！");
    }

    public function staffDel(StaffService $staffService , Request $request)
    {
        $params = $request->input();
        $result = $staffService->staffDelete($params);
        if($result)
            return $this->responseSuccess($result);
        else
            return $this->responseError("删除失败，请重试！");
    }
}
